//
//  SYS_MemberDetailCell.m
//  System_App
//
//  Created by 魏配军 on 2017/12/5.
//  Copyright © 2017年 czy001. All rights reserved.
//

#import "SYS_MemberDetailCell.h"

@implementation SYS_MemberDetailCell


-(instancetype)initWithTableView:(UITableView *)tableView  reuseId:(NSString *)reuseId
{
    
    SYS_MemberDetailCell *cell = [tableView dequeueReusableCellWithIdentifier:reuseId];
    if (!cell) {
        cell=[[SYS_MemberDetailCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reuseId];
    }
    return cell;
}

-(instancetype) initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self=[super initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reuseIdentifier];
    if (self) {
        [self addView];
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        
    }
    return self;
}

-(void) addView
{
    _iconImageView=[UIImageView new];
    
    _nameLabel=[[UILabel alloc]init];
    _nameLabel.textAlignment=NSTextAlignmentLeft;
    _nameLabel.font=[UIFont fontWithName:@"PingFangSC-Regular" size:15];
    _nameLabel.font=[UIFont systemFontOfSize:14];
    _nameLabel.textColor=DGHColorAlpha(20, 20, 20, 1);
    
    _explainLabel=[[UILabel alloc]init];
    _explainLabel.textAlignment=NSTextAlignmentRight;
    _explainLabel.font=[UIFont fontWithName:@"PingFangSC-Regular" size:15];
    _explainLabel.font=[UIFont systemFontOfSize:13];
    _explainLabel.textColor=DGHColorAlpha(168, 168, 168, 1);
    
    _lineView=[UIView new];
    _lineView.backgroundColor=DGHColor(221, 221, 221);
    
    [self.contentView sd_addSubviews:@[_iconImageView,_nameLabel,_explainLabel,_lineView]];
    
    _iconImageView.sd_layout
    .leftSpaceToView(self.contentView, 10)
    .topSpaceToView(self.contentView, 10)
    .widthIs(30)
    .heightIs(30);
    
    _nameLabel.sd_layout
    .leftSpaceToView(_iconImageView, 10)
    .topSpaceToView(self.contentView, 15)
    .widthIs(60)
    .heightIs(20);
    
    _explainLabel.sd_layout
    .rightSpaceToView(self.contentView, 10)
    .topSpaceToView(self.contentView, 15)
    .widthIs(SCREENWIDTH-120)
    .heightIs(20);
    
    _lineView.sd_layout
    .leftSpaceToView(self.contentView, 0)
    .bottomEqualToView(self.contentView)
    .widthIs(SCREENWIDTH)
    .heightIs(0.5);
    
    
}

-(void)setIsSetFrame:(BOOL)isSetFrame
{
    _nameLabel.font=[UIFont systemFontOfSize:12];
    _nameLabel.textColor=DGHColorAlpha(70, 70, 70, 1);
    _explainLabel.font=[UIFont systemFontOfSize:12];
    
    _iconImageView.sd_layout
    .leftSpaceToView(self.contentView, 10)
    .topSpaceToView(self.contentView, 10)
    .widthIs(30)
    .heightIs(30);
    
    _nameLabel.sd_layout
    .leftSpaceToView(_iconImageView, 10)
    .topSpaceToView(self.contentView, 15)
    .widthIs(70)
    .heightIs(20);
    
    _explainLabel.sd_layout
    .rightSpaceToView(self.contentView, 10)
    .topSpaceToView(self.contentView, 15)
    .widthIs(SCREENWIDTH-140)
    .heightIs(20);
    
    _lineView.sd_layout
    .leftSpaceToView(self.contentView, 0)
    .bottomEqualToView(self.contentView)
    .widthIs(SCREENWIDTH)
    .heightIs(0.5);
}





@end
